export CC=g++
export CFLAGS=-Wall -pedantic
export LDFLAGS=

SOURCE_DIR=source
TEST_DIR=test

BUILDER_DIR=$(SOURCE_DIR)/builder
FACTORY_DIR=$(SOURCE_DIR)/factory
STRATEGY_DIR=$(SOURCE_DIR)/strategy

SRC_SOURCE= $(wildcard $(SOURCE_DIR)/*.cpp)
OBJ_SOURCE= $(SRC_SOURCE:.cpp=.o)

SRC_BUILDER= $(wildcard $(BUILDER_DIR)/*.cpp)
OBJ_BUILDER= $(SRC_BUILDER:.cpp=.o)

SRC_FACTORY= $(wildcard $(FACTORY_DIR)/*.cpp)
OBJ_FACTORY= $(SRC_FACTORY:.cpp=.o)

SRC_STRATEGY= $(wildcard $(STRATEGY_DIR)/*.cpp)
OBJ_STRATEGY= $(SRC_STRATEGY:.cpp=.o)

all :	
	@(cd $(SOURCE_DIR) && $(MAKE))
	$(CC) $(OBJ_SOURCE) $(OBJ_BUILDER) $(OBJ_FACTORY) $(OBJ_STRATEGY) main.cpp -o vertexCover
	
test :	all
	@(cd $(TEST_DIR) && $(MAKE))
	mv test/vertexCoverTest .

clean :
	@(cd $(SOURCE_DIR) && $(MAKE) $@)
	@(cd $(TEST_DIR) && $(MAKE) $@)
	rm -f vertexCover* minisat-*
	
mrproper: clean
	@(cd $(SOURCE_DIR) && $(MAKE) $@)
	@(cd $(TEST_DIR) && $(MAKE) $@)
	

